package com.goods.controller.business;

import com.goods.business.service.ConsumerService;
import com.goods.common.model.business.Consumer;
import com.goods.common.response.ResponseBean;
import com.goods.common.vo.business.ConsumerVO;
import com.goods.common.vo.system.PageVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@Api(tags = "业务模块-物资去处相关接口")
@RestController
@RequestMapping("/business/consumer/findConsumerList?pageNum=1&pageSize=10&name=")
public class ConsumerController {

    @Autowired
    private ConsumerService consumerService;

    @ApiOperation(value = "物资去处分页列表展示 && 条件查询")
    @GetMapping("/findConsumerList")
    public ResponseBean findConsumerList(
            @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
            @RequestParam(value = "pageSize",defaultValue = "5") Integer pageSize,
            ConsumerVO consumerVO
    ){
        PageVO<Consumer> consumerList =
                consumerService.findConsumerList(pageNum,pageSize,consumerVO);
        return ResponseBean.success(consumerList);
    }

}
